<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent">
    <div
      class="content-parent border-hover-style"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style15/Auxiliaryoutlinestyle3Bg.webp'})`,
      }"
    >
      <div class="audio-parent">
        <audioCom :info="props.info" ref="audioParent" />
      </div>

      <div class="content">
        <div class="img-parent">
          <div v-if="(props.info.video && props.info.video.url) || props.info.value" class="img-box">
            <videoview
              @click="audioplay(false)"
              :info="props.info"
              v-if="props.info.video && props.info.video.url"
            ></videoview>
            <div v-else class="outline-cover">
              <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
            </div>
          </div>
        </div>
        <div
          class="content-bottom-1"
          :class="{
            content4: !props.info.subTitle && !props.info.remarks,
            content3: props.info.subTitle && !props.info.remarks,
          }"
        >
          <div class="title-box">{{ props.info.text }}</div>

          <p class="subtitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>

          <div class="remarks1" v-if="props.info.subTitle && props.info.remarks">
            <TextMax
              :types="4"
              :color2="false"
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks" 
              :title="props.info.text"
              :row="6"
            ></TextMax>
          </div>
          <div class="remarks2" v-else-if="props.info.remarks">
            <TextMax
              :types="4"
              :color2="false"
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="8"
            ></TextMax>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

 
 
<script setup lang="ts">
import audioCom from './audioCom.vue';
import { publicUrls, textType } from '@/utils/minxin';
import { useProjectStore } from '@/store';
import { urls } from '@/utils/request/upload';
import { defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/textMax15.vue';
import videoview from './../../../videoDialog/videoview.vue';

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

const ImgVisible = ref(false);
const audioRef = ref(null);
const audioParent = ref(null);
const videoRef = ref(null);
const isPlay = ref(false);
const store = useProjectStore();
const audioplay = (flag: boolean = true) => {
  audioParent.value.videoplay();
};
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  // align-items: flex-end;
  position: relative;
  margin-top: 0;
  height: 100%;
  margin-right: 140px;
}
.content-parent {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: 60px;
  width: 678px;
  height: 400px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.audio-parent {
  position: absolute;
  bottom: 8px;
  right: 18px;
  width: 50px;
  height: 50px;
  z-index: 16;
}
.content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 678px;
  height: 400px;
  padding: 35px 48px 0px 282px;
}

.title-box {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 30px;
  color: rgba(28, 68, 56, 1);
  text-align: center;
  /* 三级标题 */
  font-family: SourceHanSerifCN-Bold;
  font-size: 20px;
  line-height: 30px; /* 150% */
}
.img-parent {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 16.5px;
  left: 17px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  overflow: hidden;
}
.img-box {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  :deep(video) {
    background: rgba(57, 56, 54, 0.1);
  }
  .outline-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    overflow: hidden;
    img {
      transition: all 0.3s;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }
}
.content-bottom-1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.content4 {
  padding-top: 150px;
}
.content3 {
  padding-top: 94px;
}
.subtitle {
  display: flex;
  align-items: center;
  width: 348px;
  height: 56px;
   font-family: SourceHanSerifCN;
  font-size: 18px;
  font-weight: 400;
  line-height: 28px;
  color: rgba(28, 68, 56, 1);
  text-align: center;
  margin-top: 8px;
}

.img-box:hover {
  .outline-cover {
    img {
      transform: scale(1.2);
    }
  }
}

.remarks1 {
  display: flex;
  align-items: center;
  width: 348px;
  height: 192px;
  margin-top: 12px;
}

.remarks2 {
  display: flex;
  align-items: center;
  width: 348px;
  height: 256px;
  margin-top: 12px;
}
</style>
